package com.wuh.config;

import java.io.File;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer{

	@Override
	public void addResourceHandlers(ResourceHandlerRegistry registry) {
		String path = new String("src/main/resources/" + "static");
		File staticFile = new File(path);
		registry.addResourceHandler("/castleFile/**").addResourceLocations("file:" + staticFile.getAbsolutePath() +  File.separator + "castleFile" +  File.separator);
		registry.addResourceHandler("/groupheadImg/**").addResourceLocations("file:" + staticFile.getAbsolutePath() +  File.separator + "groupheadImg" +  File.separator);
	}
}
